<include file="Public/header" />

<div class="container padding-0 content-border">

    <!--个人信息-->
    <div class="login-user-info clearfix">
        <div class="pull-left">
            <img class="user-avatar-big" src="{$user.avatar_url}">
        </div>
        <div class="user-msg <empty name='member.is_member'>m-off</empty>">
            <div>
                <h2>{$user.nickname}</h2>
                <div class="mark-info"><i class="m-icon m-mark"></i><span <empty name='member.next_level'>hidden</empty>>距离下个等级：{$member['next_level']['member_level']}，还需{$member['next_level']['member_days']}天、{$member['next_level']['sheet_click']}首</span></div>
            </div>
            <div class="m-info">
                <i class="m-icon m-level"></i>乐手等级：{$member.member_level}
            </div>
            <div class="m-info">
                <i class="m-icon m-days"></i>登录天数：{$member.member_days}天
            </div>
            <div class="m-info">
                <i class="m-icon m-use"></i>使用量：{$member.sheet_click}首
            </div>
            <!--<div>
                <empty name="member.is_member">
                    <a class="btn purchase-btn" id="newbuy">购买会员</a>
                <else/>
                    <a class="btn purchase-btn" id="renew">续费</a>
                </empty>
            </div>-->
        </div>
    </div>

    <!--创建的谱单-->
    <div class="bg-white">
        <div class="clearfix">
            <h4 class="title-border font-bold">我创建的谱单</h4>
        </div>
    </div>
    <div>
        <ul class="user-score-body">
            <!--我喜欢的曲谱-->
            <li class="recommand-score-info margin-bottom-30 margin-right-20">
                <a href="{:U('score/myFavSheet','uid='.$user['id'])}" class="color-black display-inlineblock">
                    <img class="recommand-score-img" src="__IMG__/fav_sheet.jpg" />
                    <!--收藏遮罩-->
                    <div class="recommand-score-collect"></div>
                    <p class="recommand-score-collect-info"><img class="padding-right-10" src="__IMG__/collect.png">{$favSheetCount}</p>
                </a>
                <span class="recommand-score-title bg-white">
                    <a href="{:U('score/index?id='.$score['id'])}" class="color-black display-inlineblock font-size-16">我喜欢的曲谱</a>
                </span>
            </li>
            <!--单个谱单-->
            <notempty name="create_score_list">
                <volist name="create_score_list" id="score">
                    <li class="recommand-score-info margin-bottom-30 margin-right-20">
                        <a href="{:U('score/index?id='.$score['id'])}" class="color-black display-inlineblock">
                            <img class="recommand-score-img" <empty name="score.img_url">src="__IMG__/score-pic1.png"<else/>src="{$score.img_url}"</empty> />
                            <!--收藏遮罩-->
                            <div class="recommand-score-collect"></div>
                            <p class="recommand-score-collect-info"><img class="padding-right-10" src="__IMG__/collect.png">{$score.fav_count}</p>
                        </a>
                        <span class="recommand-score-title bg-white">
                            <a href="{:U('score/index?id='.$score['id'])}" class="color-black display-inlineblock font-size-16">{$score.name}</a>
                        </span>
                    </li>
                </volist>
            <else/>

            </notempty>
        </ul>
    </div>

    <!--收藏的谱单-->
    <notempty name="fav_score_list">
        <div class="bg-white">
            <div class="clearfix">
                <h4 class="title-border font-bold">我收藏的谱单</h4>
            </div>
        </div>

        <div>
            <ul class="user-score-body">
                <!--单个谱单-->
                <volist name="fav_score_list" id="score">
                    <li class="recommand-score-info margin-bottom-30 margin-right-25">
                        <a href="{:U('score/index?id='.$score['id'])}" class="color-black display-inlineblock">
                            <img class="recommand-score-img" <empty name="score.img_url">src="__IMG__/score-pic1.png"<else/>src="{$score.img_url}"</empty> />
                            <!--收藏遮罩-->
                            <div class="recommand-score-collect"></div>
                            <p class="recommand-score-collect-info"><img class="padding-right-10" src="__IMG__/collect.png">{$score.fav_count}</p>
                        </a>
                        <span class="recommand-score-title bg-white">
                            <a href="{:U('score/index?id='.$score['id'])}" class="color-black display-inlineblock font-size-16">{$score.name}</a>
                        </span>
                    </li>
                </volist>
            </ul>
        </div>
    </notempty>
</div>

<include file="Public/footer" />
<script>
    $('#renew').click(function () {
        //验证是否登录
        var url = '/Home/login/check';
        $.get(url, function (result) {
            if (result.code == 200) {
                var uid = "{$loginUser['uid']}";
                var member_url = '/Home/member/index/uid/' + uid;
                console.log(member_url);
                layer.open({
                    type: 2,
                    title: '',
                    area: ['700px', '580px'],
                    content: member_url, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                    end: function () {
                        window.location.href = '/Home/user/index/id/' + uid;
                    }
                });
            } else if (result.code == 10001) {
                //登录窗口
                layer.open({
                    type: 2,
                    title: '',
                    shadeClose: true,
                    area: ['600px', '420px'],
                    content: '/Home/login/index'
                });
            }
        });
    });

    $('#newbuy').click(function () {
        //验证是否登录
        var url = '/Home/login/check';
        $.get(url, function (result) {
            if (result.code == 200) {
            var uid = "{$loginUser['uid']}";
            layer.open({
                type: 2,
                title: '',
                area: ['700px', '580px'],
                content: '/Home/member/preSelect', //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                end: function () {
                    window.location.href = '/Home/user/index/id/' + uid;
                }
            });
            } else if (result.code == 10001) {
                //登录窗口
                layer.open({
                    type: 2,
                    title: '',
                    shadeClose: true,
                    area: ['600px', '420px'],
                    content: '/Home/login/index'
                });
            }
        });
    })
</script>